n = int(input())
arr = []
count = 1
for i in range(n):
  arr.append([])
  for j in range(n-i):
    arr[i].append(count)
    count += 1
res = []
for i in range(n):
  res.append([])
  for j in range(n-i):
    res[i].append(arr[j][i])
for i in range(n):
  for j in range(len(res[i])):
    if j == len(res[i])-1:
      print(res[i][j])
    elif j==0 or j==1:
      print(res[i][j], '  ', end="")
    else:
      print(res[i][j], ' ', end="")